package com.itheima.tlias84;

import com.itheima.tlias84.entity.Teacher;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class Tlias84Application {

    public static void main(String[] args) {

        SpringApplication.run(Tlias84Application.class, args);
    }

    /**
     * 通过@Bean创建的Bean对象默认是创建该Bean的方法名
     * 一般用于自动配置第三方的连接信息对象,例如 阿里云Oss
     * @return
     */

    @Bean("zhangsan")
    public Teacher createTeacherOne() {
        Teacher teacher = new Teacher("张三", 18);
        return teacher;
    }

    @Bean("lisi")
    public Teacher createTeacherTwo() {
        Teacher teacher2 = new Teacher("李四", 28);
        return teacher2;
    }

}
